enum SpuStatus {
  toEnable('TO_ENABLE', '待上架'),
  enabled('ENABLED', '销售中'),
  disabled('DISABLED', '已下架');

  final String value;
  final String label;

  const SpuStatus(this.value, this.label);

  static SpuStatus fromValue(String value) {
    return values.firstWhere(
      (status) => status.value == value,
      orElse: () => SpuStatus.toEnable,
    );
  }

  @override
  String toString() => value;
}
